package com.cskaoyan.wxcontroller;

import com.cskaoyan.bean.baseresultVO.BaseData;
import com.cskaoyan.bean.baseresultVO.BaseRespVo;
import com.cskaoyan.bean.baseresultVO.WxResultListVo;
import com.cskaoyan.bean.domain.Topic;
import com.cskaoyan.bean.wxTopic.WxDetailVo;
import com.cskaoyan.bean.wxTopic.WxTopicListVo;



import com.cskaoyan.service.WxTopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author lirui
 * @Date 2021/12/2 17:43
 * @describe:
 */
@RestController
@RequestMapping("wx/topic")
public class WxTopicController {

    @Autowired
    WxTopicService wxTopicService;

    @RequestMapping("list")
    public BaseRespVo topicList(Integer page,Integer limit){
        WxTopicListVo data =wxTopicService.getTopicList(page,limit);
        return BaseRespVo.ok(data);

    }

    @RequestMapping("detail")
    public BaseRespVo detailList(Integer id){
        WxDetailVo data = wxTopicService.queryTopic(id);
        return BaseRespVo.ok(data);

    }

    @RequestMapping("related")
    public BaseRespVo relatedList(Integer id){
        WxResultListVo data=wxTopicService.queryRelatedList(id);

        return BaseRespVo.ok(data);
        

    }
}
